package br.com.puertorico.model.validator.constraints;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import br.com.puertorico.common.utils.Validate;

public class SenhaValidator implements ConstraintValidator<Senha, String> {

	@Override
	public void initialize(Senha constraintAnnotation) {

	}

	@Override
	public boolean isValid(String value, ConstraintValidatorContext context) {
		if (value == null || value.isEmpty()) {
			return true;
		}

		return Validate.validarSenha(value);
	}

}
